package com.t35.ssh.dao;

import java.io.Serializable;
import java.util.Collection;
import java.util.List;

import org.hibernate.criterion.DetachedCriteria;

public interface BaseDao<T> {
	public Serializable save(T entity);
	
	public T get(Serializable id);
	
	public void update(T entity);
	
	public void saveOrUpdate(T entity);
	
	public T merge(T entity);
	
	public void delete(T entity);
	
	public void deleteAll(Collection<T> entities);
	
	public List<T> findByCriteria(DetachedCriteria criteria);
	
	public List<T> findByCriteria(DetachedCriteria criteria,int firstResult,int maxResults);
	
	public List<T> findByPage(DetachedCriteria criteria,int pageNo,int pageSize);
	
	public Long getRowCount(DetachedCriteria criteria);
	
	public List<T> findByExample(T exampleEntity);
	
	public List<T> find(String hql,Object...objects  );
	
	public List<T> findAll();
	
	public List<Object[]> findProjectionsByCriteria(DetachedCriteria criteria);
	
}
